
echo "Algorithm项目 代码量统计"
echo ""
javaPath=../AlgorithmJavaVersion/src
goPath=../AlgorithmGoVersion/src

Algorithm=$(find $javaPath/Algorithm/     -iname "*.java" |grep -v Test |wc -l)
DS=$(find $javaPath/DataStructure/        -iname "*.java" |grep -v Test |wc -l)
Design=$(find  $javaPath/DesignPattern/   -iname "*.java" |grep -v Test |wc -l)

AlgorithmUT=$(find $javaPath/UnitTest/AlgorithmTest  -iname "*.java" |grep  Test |wc -l)
DSUT=$(find $javaPath/UnitTest/DataStructureTest     -iname "*.java" |grep  Test |wc -l)
DesignUT=$(find $javaPath/UnitTest/DesignPatternTest -iname "*.java" |grep  Test |wc -l)

AlgorithmNum=$(find $javaPath/Algorithm/  -name "*.java"|grep -v Test|xargs cat |wc -l)
DSNum=$(find $javaPath/DataStructure      -name "*.java"|grep -v Test|xargs cat |wc -l)
DesignNum=$(find $javaPath/DesignPattern  -name "*.java"|grep -v Test|xargs cat |wc -l)

AlgorithmUTNum=$(find $javaPath/UnitTest/AlgorithmTest   -name "*.java"|xargs cat |wc -l)
DSUTNum=$(find $javaPath/UnitTest/DataStructureTest      -name "*.java"|xargs cat |wc -l)
DesignUTNum=$(find $javaPath/UnitTest/DesignPatternTest  -name "*.java"|xargs cat |wc -l)

TotalCode=$((   Algorithm      + DS      + Design))
TotalUT=$((     AlgorithmUT    + DSUT    + DesignUT))
TotalCodeNum=$((AlgorithmNum   + DSNum   + DesignNum))
TotalTestNum=$((AlgorithmUTNum + DSUTNum + DesignUTNum))

Total=$((   TotalCode    + TotalUT))
TotalNum=$((TotalCodeNum + TotalTestNum))

echo "### [Java语言入口](https://gitee.com/ljfirst/AlgorithmPractice/tree/master/AlgorithmJavaVersion)"
echo "![Java项目代码总数量](https://img.shields.io/badge/Java_Code_Num-"$Total"-brightgreen.svg)"
echo "![Java项目代码总行数](https://img.shields.io/badge/Java_Code_Line-"$TotalNum"-blue.svg)"

echo ""
echo "| JavaVersion |  Total  | Algorithm  | DataStructure  | DesignPattern |"
echo "| --------    | :-----: |  :----:    |  :-----:       |    :-----:    |"
echo "| Code/UT     |  $TotalCode/ $TotalUT   | $Algorithm/ $AlgorithmUT   |  $DS/ $DSUT      |  $Design/$DesignUT |"
echo "| CodeNum/TestNum | $TotalCodeNum/ $TotalTestNum | $AlgorithmNum/ $AlgorithmUTNum  | $DSNum/ $DSUTNum  | $DesignNum/$DesignUTNum |"

goAlgorithm=$(find $goPath/Algorithm/     -iname "*.go" |grep -v Test |wc -l)
goDS=$(find $goPath/DataStructure/        -iname "*.go" |grep -v Test |wc -l)
goDesign=$(find  $goPath/DesignPattern/   -iname "*.go" |grep -v Test |wc -l)

goAlgorithmUT=$(find $goPath/UnitTest/AlgorithmTest  -iname "*.go" |grep  Test |wc -l)
goDSUT=$(find $goPath/UnitTest/DataStructureTest     -iname "*.go" |grep  Test |wc -l)
goDesignUT=$(find $goPath/UnitTest/DesignPatternTest -iname "*.go" |grep  Test |wc -l)

goAlgorithmNum=$(find $goPath/Algorithm/  -name "*.go"|grep -v Test|xargs cat |wc -l)
goDSNum=$(find $goPath/DataStructure      -name "*.go"|grep -v Test|xargs cat |wc -l)
goDesignNum=$(find $goPath/DesignPattern  -name "*.go"|grep -v Test|xargs cat |wc -l)

goAlgorithmUTNum=$(find $goPath/UnitTest/AlgorithmTest   -name "*.go"|xargs cat |wc -l)
goDSUTNum=$(find $goPath/UnitTest/DataStructureTest      -name "*.go"|xargs cat |wc -l)
goDesignUTNum=$(find $goPath/UnitTest/DesignPatternTest  -name "*.go"|xargs cat |wc -l)

goTotalCode=$((   goAlgorithm      + goDS      + goDesign))
goTotalUT=$((     goAlgorithmUT    + goDSUT    + goDesignUT))
goTotalCodeNum=$((goAlgorithmNum   + goDSNum   + goDesignNum))
goTotalTestNum=$((goAlgorithmUTNum + goDSUTNum + goDesignUTNum))

goTotal=$((   goTotalCode    + goTotalUT))
goTotalNum=$((goTotalCodeNum + goTotalTestNum))

echo ""
echo "### [go语言入口](https://gitee.com/ljfirst/AlgorithmPractice/tree/master/AlgorithmGoVersion)"
echo "![Go项目代码总数量](https://img.shields.io/badge/GO_Code_Num-"$goTotal"-brightgreen.svg)"
echo "![Go项目代码总行数](https://img.shields.io/badge/GO_Code_Line-"$goTotalNum"-blue.svg)"
echo ""

echo "| GoVersion |  Total  | Algorithm  | DataStructure  | DesignPattern |"
echo "| --------    | :-----: |  :----:    |  :-----:       |    :-----:    |"
echo "| Code/UT     |  $goTotalCode/ $goTotalUT   | $goAlgorithm/ $goAlgorithmUT   |  $goDS/ $goDSUT      |  $goDesign/$goDesignUT |"
echo "| CodeNum/TestNum | $goTotalCodeNum/ $goTotalTestNum | $goAlgorithmNum/ $goAlgorithmUTNum  | $goDSNum/ $goDSUTNum  | $goDesignNum/$goDesignUTNum |"
echo ""


